<template>
  <div class="crumb">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> -->
      <el-breadcrumb-item v-for="item,index in crumbData" :key="index">{{ item }}</el-breadcrumb-item>
      </el-breadcrumb>
  </div>
</template>

<script>
export default {
  data () {
    return {
      // 路由变化,titles就要变化,所以要监听$route
      crumbData: []
    }
  },
  watch: {
    $route: {
      handler(val, oldVal) {
        this.crumbData = val.meta.titles;
      },
      immediate:true,
    },
    
  },
  components: {

  },
  mounted() {

  },
  methods: {

  },
}

</script>
<style scoped lang='less'>
.crumb .el-breadcrumb{
  line-height: 46px;
  font-size: 15px;
}
</style>